package com.zy.aop.excerse1;

/**
 * Created by zy on 2015/11/28.
 */
public class ThreadTest {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("submain is" + Thread.currentThread().getId());
                Thread.currentThread().interrupt();
                System.out.println(Thread.currentThread().getState().toString());
//                try {
//                   // Thread.currentThread().sleep(1000L);
//
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
                while (!Thread.currentThread().isInterrupted()) {
                    System.out.println("hello,i am not interrupted!");
                    Thread.currentThread().interrupt();
                }
            }
        }).start();
        System.out.println("main is" + Thread.currentThread().getId());
    }
}
